#pragma once

#include <QObject>
#include <QMap>

#include "Action.h"

namespace kryptos { namespace controller {

class KeyOperationsManager : public QObject
{
  Q_OBJECT
  public:

    static KeyOperationsManager& manager();

    void createKey(QMap<QString, QString> params);
    void shareKey (QMap<QString, QString> params);

signals:
    void keyOperationStarted ();
    void keyOperationEnded   ();
    void keyOperationProgress(int);
    void keyOperationError   (QString);

private slots:
    void slotCreateKeyFinished(bool success);

  private:
    KeyOperationsManager();

    QScopedPointer<kryptos::actions::Action> m_currentAction;
};

}}
